package org.springblade.modules.admin.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import org.springblade.modules.admin.vo.MsgTypeVO;

import java.util.ArrayList;
import java.util.List;

/**
 * @Date 9:00 2022/3/11
 * @Description {
 *   关联模板周期类型
 * }
 * @Author lsay
 **/
@Getter
@AllArgsConstructor
public enum CompanyCategoryEnum {

	MAINTAIN_COMPANY(1,"维保公司"),
	ESTATE_COMPANY(2,"物业公司");

	final int id;

	final String name;

	/**
	 * 根据id获取枚举name值
	 * @param id 枚举id
	 * @return name值
	 */
	public static String getName(Integer id){
		if (id == null) {
			return null;
		}
		CompanyCategoryEnum[] values = CompanyCategoryEnum.values();
		for(CompanyCategoryEnum companyCategoryEnum :values){
			Integer enumId = companyCategoryEnum.getId();
			if(id.equals(enumId)){
				return companyCategoryEnum.getName();
			}
		}
		return null;
	}

}
